package com.springcloud.eureka_consumer.remote.impl;

import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import com.springcloud.eureka_consumer.remote.interfaces.UserRemoteI;

/**
 * @author hw
 * 熔断器的fallback类，feign接口中方法多次远程调用失败后，此类相应的方法会返回值
 *
 */
@Component
public class UserRemoteHystrix implements UserRemoteI {

	/* 
	 * 当Feign接口中getUser方法多次调用失败时，就调用此getUser方法
	 */
	@Override
	public String getUser(@PathVariable("id") int id) {
		// TODO Auto-generated method stub
		return "从provider-user获取id为 "+id+" 的用户失败，请稍后再试！";
	}

}
